GET
/v1/payments/{id}Retrieve Payment Status
Check if a payment succeeded, failed, or is pending. Use this endpoint to poll for payment status or verify payment completion.
Overview
Retrieve the current status and details of a payment by its ID. This endpoint is useful for checking payment status after creation or when webhook delivery fails.
Payment Statuses:
pending- Payment is being processedsucceeded- Payment completed successfullyfailed- Payment was declined or failedrefunded- Payment has been refunded
Request
Path Parameters
idrequired
The payment ID returned when creating the payment
Code Examples
curl -X GET "https://api.altafinex.com/v1/payments/pay_1234567890abcdef" \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
Response
Status Codes
200
Payment retrieved successfully401
Authentication failed404
Payment not foundSuccess Response
Example response for a successful request
{
"payment_id": "pay_1234567890abcdef",
"status": "succeeded",
"amount": 10000,
"currency": "THB",
"description": "Payment for order #12345",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:15Z",
"card": {
"last4": "1111",
"brand": "visa"
}
}Error Response
Example response for an error
{
"error": {
"code": "payment_not_found",
"message": "The payment with the specified ID was not found",
"type": "not_found"
}
}